feat(llm): support Kimi Code models (kimi-for-coding, k3)#117
Merged
Conversation
Kimi Code's OpenAI-compatible endpoint (https://api.kimi.com/coding/v1) rejects any explicit temperature other than the default (1) with a 400 "invalid temperature: only 1 is allowed for this model". Add the kimi-for-coding* and k3* model ID prefixes to modelForbidsTemperature so the client omits the field, matching the existing handling for OpenAI reasoning models. Also wire the documented --temperature CLI flag into the agent config: it was parsed into flags.Temp but never consumed, so every run kept the hardcoded deterministic default (0). The continue command takes no CLI flags and keeps the fixed default.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
odek | 065dc81 | Commit Preview URL Branch Preview URL |
Jul 26 2026, 07:01 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes odek work against Kimi Code's OpenAI-compatible endpoint (
https://api.kimi.com/coding/v1), model IDskimi-for-coding,kimi-for-coding-highspeed,k3,k3-256k.Changes
internal/llm/client.go— Kimi Code rejects any explicittemperatureother than the default (1) with400 invalid temperature: only 1 is allowed for this model. Added thekimi-for-codingandk3prefixes tomodelForbidsTemperatureso the client omits the field, matching the existing handling for OpenAI reasoning models (o1/o3/o4, gpt-5).cmd/odek/main.go— the documented--temperatureflag was parsed intoflags.Tempbut never consumed; every run kept the hardcoded deterministic default (0). Wired it into the agent config (odek run).odek continuetakes no CLI flags and keeps the fixed default.internal/llm/client_test.go— extendedTestCall_OmitsTemperatureForReasoningModelswith Kimi cases (incl. case-insensitivity and a negativekimi-latestcontrol for Moonshot-platform models).Verification
kimi-for-coding: plain runs and tool-calling loops (math_eval) succeed; context window (262144) is auto-discovered from/models.go test ./internal/llm/ ./cmd/odek/ -count=1— both packages pass.